/**
 * 数组转map
 * @param {*} arr [{ id: 0, name: '可用' }] 形如[{id:'',name:''},...]
 * @returns {*} Object
 */
export const arrayToMap = arr => {
  return arr.reduce((prev, next) => {
    prev[next.id] = next.name
    return prev
  }, {})
}